#coding: utf-8

import time
from oled import OLed
from img2bin import img2bindata

def showImg(
    img_fpath:str,
    threshold:int=200,
    oled_addr:str=0x3c,
    oled_width:int=128,
    oled_height:int=64
    ):
    oled = OLed(0x3C)
    oled.clear()
    time.sleep(1)
    data = img2bindata(img_fpath, threshold=threshold,
            resize=(128, 64))
    oled.showImageData(data)


if __name__ == '__main__':
    import fire

    fire.Fire(showImg)
